# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=neochat
pkgver=24.08.2
pkgrel=2
pkgdesc="A client for Matrix, the decentralized communication protocol"
url="https://invent.kde.org/network/neochat/"
# armhf blocked by qt6-qtdeclarative -> kirigami
# riscv64, s390x, ppc64le and loongarch64 blocked by qt6-qtwebengine -> qt6-qtwebview
arch="all !armhf !riscv64 !s390x !ppc64le !loongarch64"
license="GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND BSD-2-Clause"
depends="
	kirigami
	kirigami-addons
	kitemmodels
	kquickcharts
	kquickimageeditor
	prison
	qqc2-desktop-style
	qt6-qtlocation
	"
makedepends="
	cmark-dev
	extra-cmake-modules
	kconfig-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kdoctools-dev
	ki18n-dev
	kio-dev
	kirigami-addons-dev
	kirigami-dev
	kitemmodels-dev
	knotifications-dev
	kquickimageeditor-dev
	kstatusnotifieritem-dev
	kunifiedpush-dev
	libquotient-dev
	purpose-dev
	qcoro-dev
	qqc2-desktop-style-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtmultimedia-dev
	qt6-qtsvg-dev
	qt6-qtwebview-dev
	qtkeychain-dev
	samurai
	sonnet-dev
	syntax-highlighting-dev
	"
subpackages="$pkgname-dbg $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/network/neochat.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/neochat-$pkgver.tar.xz
	neochatrc
	0001-neochat-Cherry-pick-compatibility-changes-for-libquotient-0.9.patch
	"
# No tests
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 "$srcdir"/neochatrc -t "$pkgdir"/etc/xdg
}

sha512sums="
fd0ad48a76dcf65b5f1f0b31685738694a142645f3c24eab931d2c09b2f0c3c3956730f5ef591f29f72cf050fd795091110c4c570906b07fd266e8cb40b2a148  neochat-24.08.2.tar.xz
d57214940e739639895b2cb140c7cedbfbc515662e8aa58adab339466ea8e87e95e087347aab7a4006287290515af2aa71dda4b0b9b9a40f9b297b17f92b285a  neochatrc
8955bd0c8b8d94a975b7a774f090fe61054fbaa708774341f510dd3b30bc27d98c3a357d67db35f494d87cc215a2e2acd1d2255c4a321b756fc7d014bae8cb66  0001-neochat-Cherry-pick-compatibility-changes-for-libquotient-0.9.patch
"
